Optimal. Leaf size=59 \[ \frac {\left (a^2-b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\sec ^2(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2747, 737, 212}
\begin {gather*} \frac {\left (a^2-b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\sec ^2(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 737
Rule 2747
Rubi steps
\begin {align*} \int \sec ^3(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {b^3 \text {Subst}\left (\int \frac {(a+x)^2}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^2(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{2 d}+\frac {\left (b \left (a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=\frac {\left (a^2-b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\sec ^2(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.01, size = 113, normalized size = 1.92 \begin {gather*} \frac {\left (a^2-b^2\right )^2 (\log (1-\sin (c+d x))-\log (1+\sin (c+d x)))+2 a^3 b \sec ^2(c+d x)-2 \left (a^4-b^4\right ) \sec (c+d x) \tan (c+d x)+\left (-6 a^3 b+4 a b^3\right ) \tan ^2(c+d x)}{4 \left (-a^2+b^2\right ) d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.34, size = 99, normalized size = 1.68
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {a b}{\cos \left (d x +c \right )^{2}}+b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(99\) |
default | \(\frac {a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {a b}{\cos \left (d x +c \right )^{2}}+b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(99\) |
risch | \(-\frac {i \left (a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-a^{2} {\mathrm e}^{i \left (d x +c \right )}-b^{2} {\mathrm e}^{i \left (d x +c \right )}+4 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}\right )}{d \left (1+{\mathrm e}^{2 i \left (d x +c \right )}\right )^{2}}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{2 d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{2 d}\) | \(174\) |
norman | \(\frac {\frac {\left (a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {\left (a^{2}+b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {3 \left (a^{2}+b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {3 \left (a^{2}+b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {8 a b \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 a b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 a b \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {\left (a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {\left (a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(228\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.31, size = 78, normalized size = 1.32 \begin {gather*} \frac {{\left (a^{2} - b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (a^{2} - b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (2 \, a b + {\left (a^{2} + b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 90, normalized size = 1.53 \begin {gather*} \frac {{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 4 \, a b + 2 \, {\left (a^{2} + b^{2}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \sec ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 4.41, size = 86, normalized size = 1.46 \begin {gather*} \frac {{\left (a^{2} - b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - {\left (a^{2} - b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (a^{2} \sin \left (d x + c\right ) + b^{2} \sin \left (d x + c\right ) + 2 \, a b\right )}}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.11, size = 62, normalized size = 1.05 \begin {gather*} \frac {\mathrm {atanh}\left (\sin \left (c+d\,x\right )\right )\,\left (\frac {a^2}{2}-\frac {b^2}{2}\right )}{d}-\frac {a\,b+\sin \left (c+d\,x\right )\,\left (\frac {a^2}{2}+\frac {b^2}{2}\right )}{d\,\left ({\sin \left (c+d\,x\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________